<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2020 the OpenProject GmbH

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.

OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2017 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

See docs/COPYRIGHT.rdoc for more details.

++#%>

<% work_package = issue %>

<% if work_package.is_story? && params[:copy_from] %>
  <div id="backlogs-attributes" class="attributes">
    <div class="form--field">
      <%= styled_label_tag :link_to_original, l(:rb_label_link_to_original) %>
      <span class="form--field-container">
        <%= styled_check_box_tag('link_to_original',
                                 params[:copy_from],
                                 true, label: l(:rb_label_link_to_original)) %>
      </span>
    </div>

    <div class="form--grouping" role="group" aria-labelledby="copy-tasks-label">
      <div id="copy_tasks_label"
           class="form--grouping-label">
        <%= l(:rb_label_copy_tasks) %>
      </div>
      <div class="form--grouping-row">
        <div class="form--field">
          <span class="form--field-container -vertical">
            <span class="form--radio-button-container">
              <label class="form--label">
                <%= radio_button_tag('copy_tasks',
                                     'open:' + params[:copy_from],
                                     true,
                                     { id: 'copy_tasks_open' }) %>
                <%= l(:rb_label_copy_tasks_open) %>
              </label>
            </span>
            <span class="form--radio-button-container">
              <label class="form--label">
                <%= radio_button_tag('copy_tasks',
                                     'none',
                                     false,
                                     { id: 'copy_tasks_none' }) %>
                <%= l(:rb_label_copy_tasks_none) %>
              </label>
            </span>
            <span class="form--radio-button-container">
              <label class="form--label">
                <%= radio_button_tag('copy_tasks',
                                     'all:' + params[:copy_from],
                                     false,
                                     { id: 'copy_tasks_all' }) %>
                <%= l(:rb_label_copy_tasks_all) %>
              </label>
            </span>
          </span>
        </div>
      </div>
    </div>
  </div>
<% end %>
